import pathlib as ptl
import sys

_bin_path: str = (ptl.Path(__file__).parents[1] / "bin" / "RelWithDebInfo").as_posix()
print(_bin_path)
sys.path.insert(0, _bin_path)
import mypybind as mybind

##xxxxxxxxxxxxxxxxxxxxxxxxxx simple functions
## https://pybind11.readthedocs.io/en/stable/basics.html#keyword-arguments
ret = mybind.add(1, 2)
print(f"simple function {ret}")

ret = mybind.add_key(i=1, j=2)
print(f"by key {ret}")

ret = mybind.add_key_short(i=1, j=2)
print(f"by key {ret}")

ret = mybind.add3()
print(f"3, by default {ret}")
ret = mybind.add4()
print(f"4, by default {ret}")


print(f"the_answer {mybind.the_answer}")
print(f"the_answer {mybind.what}")


##================= Object-oriented code
## https://pybind11.readthedocs.io/en/stable/classes.html
p = mybind.Pet("Molly")
print(f"Pet instance -> {p}")
print(p.getName())
p.setName("Charly")
print(p.getName())
# static method
print(f"class name -> {mybind.Pet.ClassName()}")
